-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake: Use "coverage" preset instead of "Coverage" build type and document it #1251
Conversation
3659000
to
5a06a5d
Compare
"displayName": "Build for coverage analysis", | ||
"generator": "Unix Makefiles", | ||
"cacheVariables": { | ||
"CMAKE_C_COMPILER": "gcc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://clang.llvm.org/docs/SourceBasedCodeCoverage.html clang supports this too, so no need to set a default here, I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't clang require the use of the llvm-cov tool, which is currently undocumented in the README.md?
Concept ACK assuming one can stack multiple presets at once. |
5a06a5d
to
98bed06
Compare
Rebased. |
After a discussion about this in-person, we've found drawbacks in the build type approach as well as the preset one. Instead, let's just do the simple thing and hook up a new option. |
Closing in favour of #1291. |
Using
-DCMAKE_BUILD_TYPE=Coverage
to configure the build for coverage analysis has a flaw as build types are not defined at the configuration stage for multi-config generators.This PR implements the idea suggested here.
Please note that both added to the
README.md
commands,cmake --build build
andctest --test-dir build
, accept the-j $(nproc)
option to parallelize work.Drafted as it is based on #1234.